The RSA Cryptosystem

 

RSA History

Problems With Secret-Key Cryptosystems

Public-Key Cryptosystems

Note: Public-Key Cryptosystems are also not void of problems. A public-key cryptosystem can never provide unconditional security because an opponent upon seeing a ciphertext, can encrypt each possible plaintext until this ciphertext is obtained.

Definition

Some Number Theory (first in order to set up for the RSA system)

More Number Theory

where the pi’s are distinct primes, n is the number of distinct primes, and ei>0 is the power of the associated prime.

Personal Note: This next result gives us a way to compute the value of f (m).

Theorem(Phi Calculation) (WRITE ON BOARD)

Proof

Recall: Corollary to LaGrange’s Theorem that says: If G is a finite group and aÎ G. Then a|G| = e.

Recall: Fermat’s Little Theorem which states:

If p is a prime and aÎ Z+ such that p does not divide a, then ap – 1 º 1 (mod p)

Personal note: now we can present the RSA system.

The RSA Cryptosystem

K = {(n, p, q, a, b) : n = pq, p, q prime, ab º 1 (mod f (n))}.

For k = (n, p, q, a, b), we define

ek(x) = xb mod n

and dk(y) = ya mod n, where x, yÎ Zn and n and b are public.

    1. A fast algorithm for finding a random prime number of a prescribed size is known.
    2. No fast algorithm for a factorization of a large number into a product of primes is known.

Verification That Encryption and Decryption are Inverse Operations

Proof

    1. Since ab º 1 (mod f (n)), then we have that ab = tf (n) + 1 for some integer t³ 1
    2. Suppose that xÎ Zn*, then we have dk(ek(x)) = (xb)a mod n
    3. (xb)a º xtf (n) + 1 (mod n) (substituting for ab)

      º (xf (n))tx (mod n) (rules of powers)

      º (x|Zn*|)tx (mod n) (since |Zn*| = f (n))

      º (1)tx (mod n) (by the corollary to LaGrange’s Theorem)

      º x (mod n)

    4. Now, suppose xÎ Zn\Zn*.
      1. From the Phi Calculation Theorem, f (n) = (p – 1)(q – 1).
      2. It is true from number theory(the Chinese Remainder theorem) that
      3. xab º x (mod pq) if and only if xab º x (mod p) and xab º x (mod q).

      4. If x º 0 (mod p), then xab º x (mod p).
      5. If x is not congruent to 0 (mod p) then
      6. xab º xtf (n) + 1 (mod p) (substituting for ab)

        º (x(p – 1))t(q - 1)x (mod p) (substituting for f (n))

        º (1)t(q - 1)x (mod p) (Fermat’s Theorem)

        º x (mod p)

      7. Similarly, we can redo steps c and d for q. This yields:
      8. xab º x (mod p) and xab º x (mod p).

      9. Hence, xab º x (mod pq).

4) Therefore, dk(ek(x)) = x.

An RSA Cryptosystem can be created as follows:

1. Select at random two large prime numbers p and q (say >100 digits each).

2. Compute n = pq.

3. Select an integer b that is relatively prime to f (n).

4. Compute a º b-1 mod f (n) (multiplicative inverse).

5. Publish pair P = (b, n) as RSA Public Key.

6. Keep pair S = (a, n) as RSA Secret Key.

7. ek(x) = xb (mod n) to encrypt.

8. dk(y) = ya (mod n) to decrypt.

Note: For all of these steps there are algorithms that will accomplish the given task in polynomial time. This means that there are algorithms such that the time of computation is no more than a polynomial function of the problem size.

Security

RSA example:

This is a small insecure example of the RSA system.

In practice, random primes are chosen of 100 digits or more.

    1. We select the primes p = 41 and q = 59. (In implementation the computer picks two random primes of prescribed size).
    2. Now we compute n = (41)(59) = 2419.
    3. Since f (n) = (p – 1)(q – 1), from the Phi Computation Theorem, then
    4. f (2419) = (40)(48) = 2320. We need to select an integer b that is relatively prime to 2320. Any such integer will work. In particular b = 3 works, because gcd(3, 2320) = 1.

    5. Now we need to compute a. a º b-1 (mod 2320)
    6. º 3-1 (mod 2320) º 1547 (mod 2320)

      Thus, a = 1547. We can check this by computing ab mod f (n) which is suppose to equal 1. (1547)(3) (mod 2320) = 1, so a and b check out.

    7. The public-key is the pair (3, 2419).
    8. The secret-key is the pair (1547, 2419).
    9. Encryption is accomplished by ek(x) = x3 (mod 2419).
    10. Decryption is accomplished by dk(y) = y1547 (mod 2419).

Subexample: If the message ‘goodbye’, corresponds to the value 516, then Alice would encrypt this message by:

ek(516) = 5163 (mod 2419) = 991, this would be sent to Bob

Oscar is in trouble unless he can factor 2419 into two primes and then calculate a. To get the plaintext back, Bob uses his secret key:

dk(991) = 9911547 (mod 2419) = 516. And he now knows that Alice has said ‘goodbye’.

Note: if all possible messages correspond to a different integer, then there are only 2419 different possible messages.

Conclusion:

References:

Adamek, Jiri. Foundations of Coding; New York: John Wiley & Sons, Inc., 1991.

Bogomolny, Alexander. Euler Function and Theorem; 2001.

<http://www.cut-the-knot.com/blue/Euler.html>.

Cook, Diane J. Lecture 23: Encyption; 2001.

<http://www-cse.uta.edu/~cook/aa/lectures/l23/l23.html>.

Hardy, Darel W. Information Integrity and Security; Colorado State University, 1999.

<http://hardy.math.colostate.edu/m460/>.

Koblitz, Neal. Algebraic Aspects of Cryptography; Springer-Verlag Berlin Heidelberg, 1998.

Stinson, Douglas R. Cryptography: Theory and Practice; CRC Press, Inc., 1995.

Using Matrices for Cryptography; 2000. <http://www.route66isp.com/~limax/Cryptography.pdf>.